package com.stone.gateway.dto;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * 路由信息
 * @author fxj
 */
@Data
public class RouteDTO {
    /**
     * ID
     */
    private String id;

    /**
     * 断言
     * 示例: Path=/test/**,/bb/**
     */
    @NotEmpty
    @Valid
    private List<String> predicates;

    /**
     * 过滤器
     * 示例: StripPrefix=1
     */
    @Valid
    private List<String> filters;

    /**
     * uri
     */
    @NotNull
    private String uri;

    /**
     * metadata
     */
    private Map<String, Object> metadata;

    /**
     * 排序
     */
    private Integer order;
}
